package com.ruoyi.common.core.domain.entity.admin;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@TableName("admin_accounting")
public class AdminAccountingDB implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 出入账
     */
    @Excel(name = "出入账")
    private Integer transactionType;

    /**
     * 交易对象
     */
    @Excel(name = "交易对象")
    private String counterpartyType;

    /**
     * 交易分类
     */
    @Excel(name = "交易分类")
    private String category;

    /**
     * 总金额（单位：元）
     */
    @Excel(name = "总金额", readConverterExp = "单=位：元")
    private BigDecimal totalAmount;

    /**
     * 总数量
     */
    @Excel(name = "总数量")
    private BigDecimal quantity;

    /**
     * 表示计量单位
     */
    @Excel(name = "表示计量单位")
    private String unitOfMeasure;

    /**
     * 单价（单位：元）
     */
    @Excel(name = "单价", readConverterExp = "单=位：元")
    private BigDecimal unitPrice;

    @Excel(name = "备注")
    private String remark;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    /**
     * 创建人ID
     */
    private Long createdBy;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedAt;

    /**
     * 修改人ID
     */
    private Long updatedBy;

    /**
     * 是否启用(0:未启用, 1:启用中)
     */
    @Excel(name = "是否启用(0:未启用, 1:启用中)")
    private Integer isActive;

    /**
     * 发票
     */
    @Excel(name = "发票地址")
    private String invoiceUrl;

    /**
     * 是否删除(0:未启用, 1:已删除)
     */
    @TableLogic
    private Integer isDeleted;

    /**
     * 删除时间
     */
    private Date deletedAt;

    /**
     * 租户id
     */
    private Long tenantId;

    // 总金额最大
//    @Excel(name = "总金额最大")
    @TableField(exist = false)
    private BigDecimal totalAmountMax;

    // 总金额最小
//    @Excel(name = "总金额最小")
    @TableField(exist = false)
    private BigDecimal totalAmountMin;

    // 创建时间范围
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdAtMin;

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdAtMax;

    @TableField(exist = false)
    private List<String> pictureList;


}
